package com.ada.demo

class Cat(cName: String) {
  var name: String = cName
}

object Cat {
  def apply(): Cat = {
    println("apply被调用")
    new Cat("xx")
  }

  def apply(name: String): Cat = {
    println("apply被调用")
    new Cat(name)
  }
}
